#include <bits/stdc++.h>

#define ll long long
#define ull unsigned long long
#define uint unsigned int

#define YES cout << "YES" << '\n'
#define NO cout << "NO" << '\n'
#define endl '\n'
const int INF = 1e9;
const int MOD = 998244353;
using namespace std;

/*思考
从大到小处理：如果当前大于c直接跳过
*/

void solve() {
    int n;
    cin >> n;
    vector<int> p(n + 1, 0);
    for (int i = 1; i <= n; i++) {
        cin >> p[i];
    }
    int l = 1;
    int r = n;
    for (int i = 1; i < n, l <= r; i++) {  // 奇数取大值，偶数取小值
        if (i % 2) {                       // 取大
            if (p[l] > p[r]) {
                cout << 'L';
                l++;
            } else {
                cout << 'R';
                r--;
            }
        } else {  // 取小
            if (p[l] > p[r]) {
                cout << 'R';
                r--;
            } else {
                cout << 'L';
                l++;
            }
        }
    }
    cout << endl;
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t = 0;
    cin >> t;
    while (t--) solve();
    return 0;
}